<template>
    <div class="cont">
        <CustomForm @submit="submit" title="添加管理员" :formList="formList"></CustomForm>
    </div>
</template>

<script setup lang="ts">
import CustomForm from '@/components/customForm/CustomForm.vue';
import { CustomFormItem, CustomFormState } from '@/components/customForm/types';

const formList = reactive<CustomFormItem[]>([
    {label: '真实姓名',key: 'name',type:'input',required:true},
    {label: '身份证号码',key: 'idNo',type: 'input',required:true},
    {label: '上传身份头像面照片',key: 'frontOfIdCard',type: 'upload',required:true},
    {label: '上传身份国徽面照片',key: 'backOfIdCard',type: 'upload',required:true},
    {label: '状态',key: 'state',type: 'radio',options: [
        {label: '通过审核',value:'1'},
        {label: '待审核',value:'2'},
    ],value:'1'},
    {value: '提交并保存',key:'submit',type: 'submit'}
])

const submit = (formState: CustomFormState) => {
    alert('表单结果为' + JSON.stringify(formState))
}
</script>

<style scoped>

</style>